package com.yzpass.api.user.controller;

import com.yzpass.api.common.Constant;
import com.yzpass.api.common.Result;
import com.yzpass.api.user.dto.AuthInfoDTO;
import com.yzpass.api.user.dto.LoginDTO;
import com.yzpass.api.user.service.LoginService;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 允许匿名访问的接口
 */
@RestController
@RequestMapping(value = Constant.API + "anonymous")
public class AnonymousController {

    @Resource
    LoginService loginService;

    @PostMapping("login")
    public Result<AuthInfoDTO> login(@RequestBody @Valid LoginDTO loginDTO)  {
        return loginService.login(loginDTO);
    }
}
